import media_by_id from './media_by_id.coffee'
import config from '~/store/record.coffee'

export default get = (i)->
  d = localStorage[i]
  if d
    s = await media_by_id[i] d
    if s
      tli = s.getTracks()
      if not config[i]
        for t from tli
          t.enabled = false
      return s
  return

export audio = get.bind(get,'audio')
export video = get.bind(get,'video')

